import { nFormatter } from '@/utils/nFormatter'

export default {
  backgroundColor: '#1c213e',
  tooltip: {
    formatter: function(val = {}) {
      const {
        data: { name, value },
        marker
      } = val
      return `${name}<br/>${marker}用气量:${value[0]}<br/>${marker}周期:${value[1]}`
    }
  },
  xAxis: {
    name: '气量系数',
    nameLocation: 'middle',
    nameGap: 30,
    nameTextStyle: {
      fontSize: 12,
      color: '#8cb6f7',
      verticalAlign: 'top'
    },
    scale: true,
    axisLine: {
      lineStyle: {
        color: '#31597d'
      }
    },
    splitLine: {
      lineStyle: {
        color: '#31597d',
        type: 'dashed'
      }
    },
    axisLabel: {
      textStyle: {
        color: '#fff'
      },
      showMaxLabel: true,
      formatter: function(val) {
        return nFormatter(val)
      }
    }
  },
  yAxis: {
    name: '周期',
    nameGap: 10,
    nameTextStyle: {
      fontSize: 12,
      color: '#8cb6f7',
      align: 'right',
      padding: [0, 8, 0, 0]
    },
    scale: true,
    axisLine: {
      lineStyle: {
        color: '#31597d'
      }
    },
    splitLine: {
      lineStyle: {
        color: '#31597d',
        type: 'dashed'
      }
    },
    axisLabel: {
      textStyle: {
        color: '#fff'
      }
    }
  },
  series: [
    {
      type: 'scatter',
      itemStyle: {
        color: 'rgba(255, 255, 0, 0.5)'
      }
    }
  ],
  grid: {
    left: '15',
    top: '25',
    right: '15',
    bottom: '25',
    containLabel: true
  }
}
